<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>虚拟DOM</title>
</head>
<script src="./js/react.development.js"></script>
<script src="./js/react-dom.development.js"></script>
<body>
    <div id="root"></div>
    <script>
        // 创建 react 元素  --->  虚拟 DOM 对象
        let vdom = React.createElement("h1",{title:"react初体验"},"学习react虚拟dom对象")

        console.log(vdom);

        console.log(document.getElementById("root"));


        //模拟代码
/* 
        let h1 = document.createElement(vdom.type);  //<h1></h1>
        h1.setattrbute(vdom.props.title,"..."); //<h1 title=""></h1>
        h1.innerHTML = vdom.props.children; */



        ReactDOM.render(vdom,document.getElementById("root"));

    </script>
</body>
</html>